<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
ConjugateGradient (Commons Math 3.2 API)
</TITLE>


<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../stylesheet.css" TITLE="Style">

<SCRIPT type="text/javascript">
function windowTitle()
{
    if (location.href.indexOf('is-external=true') == -1) {
        parent.document.title="ConjugateGradient (Commons Math 3.2 API)";
    }
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>

</HEAD>

<BODY BGCOLOR="white" onload="windowTitle();">
<HR>


<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/ConjugateGradient.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../../org/apache/commons/math3/linear/CholeskyDecomposition.html" title="class in org.apache.commons.math3.linear"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../../org/apache/commons/math3/linear/DecompositionSolver.html" title="interface in org.apache.commons.math3.linear"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../../../index.html?org/apache/commons/math3/linear/ConjugateGradient.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="ConjugateGradient.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>


</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->

<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
org.apache.commons.math3.linear</FONT>
<BR>
Class ConjugateGradient</H2>
<PRE>
<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</A>
  <IMG SRC="../../../../../resources/inherit.gif" ALT="extended by "><A HREF="../../../../../org/apache/commons/math3/linear/IterativeLinearSolver.html" title="class in org.apache.commons.math3.linear">org.apache.commons.math3.linear.IterativeLinearSolver</A>
      <IMG SRC="../../../../../resources/inherit.gif" ALT="extended by "><A HREF="../../../../../org/apache/commons/math3/linear/PreconditionedIterativeLinearSolver.html" title="class in org.apache.commons.math3.linear">org.apache.commons.math3.linear.PreconditionedIterativeLinearSolver</A>
          <IMG SRC="../../../../../resources/inherit.gif" ALT="extended by "><B>org.apache.commons.math3.linear.ConjugateGradient</B>
</PRE>
<HR>
<DL>
<DT><PRE>public class <B>ConjugateGradient</B><DT>extends <A HREF="../../../../../org/apache/commons/math3/linear/PreconditionedIterativeLinearSolver.html" title="class in org.apache.commons.math3.linear">PreconditionedIterativeLinearSolver</A></DL>
</PRE>

<P>
<p>
 This is an implementation of the conjugate gradient method for
 <A HREF="../../../../../org/apache/commons/math3/linear/RealLinearOperator.html" title="class in org.apache.commons.math3.linear"><CODE>RealLinearOperator</CODE></A>. It follows closely the template by <a
 href="#BARR1994">Barrett et al. (1994)</a> (figure 2.5). The linear system at
 hand is A &middot; x = b, and the residual is r = b - A &middot; x.
 </p>
 <h3><a id="stopcrit">Default stopping criterion</a></h3>
 <p>
 A default stopping criterion is implemented. The iterations stop when || r ||
 &le; &delta; || b ||, where b is the right-hand side vector, r the current
 estimate of the residual, and &delta; a user-specified tolerance. It should
 be noted that r is the so-called <em>updated</em> residual, which might
 differ from the true residual due to rounding-off errors (see e.g. <a
 href="#STRA2002">Strakos and Tichy, 2002</a>).
 </p>
 <h3>Iteration count</h3>
 <p>
 In the present context, an iteration should be understood as one evaluation
 of the matrix-vector product A &middot; x. The initialization phase therefore
 counts as one iteration.
 </p>
 <h3><a id="context">Exception context</a></h3>
 <p>
 Besides standard <A HREF="../../../../../org/apache/commons/math3/exception/DimensionMismatchException.html" title="class in org.apache.commons.math3.exception"><CODE>DimensionMismatchException</CODE></A>, this class might throw
 <A HREF="../../../../../org/apache/commons/math3/linear/NonPositiveDefiniteOperatorException.html" title="class in org.apache.commons.math3.linear"><CODE>NonPositiveDefiniteOperatorException</CODE></A> if the linear operator or
 the preconditioner are not positive definite. In this case, the
 <A HREF="../../../../../org/apache/commons/math3/exception/util/ExceptionContext.html" title="class in org.apache.commons.math3.exception.util"><CODE>ExceptionContext</CODE></A> provides some more information
 <ul>
 <li>key <code>"operator"</code> points to the offending linear operator, say L,</li>
 <li>key <code>"vector"</code> points to the offending vector, say x, such that
 x<sup>T</sup> &middot; L &middot; x < 0.</li>
 </ul>
 </p>
 <h3>References</h3>
 <dl>
 <dt><a id="BARR1994">Barret et al. (1994)</a></dt>
 <dd>R. Barrett, M. Berry, T. F. Chan, J. Demmel, J. M. Donato, J. Dongarra,
 V. Eijkhout, R. Pozo, C. Romine and H. Van der Vorst,
 <a href="http://www.netlib.org/linalg/html_templates/Templates.html"><em>
 Templates for the Solution of Linear Systems: Building Blocks for Iterative
 Methods</em></a>, SIAM</dd>
 <dt><a id="STRA2002">Strakos and Tichy (2002)
 <dt>
 <dd>Z. Strakos and P. Tichy, <a
 href="http://etna.mcs.kent.edu/vol.13.2002/pp56-80.dir/pp56-80.pdf">
 <em>On error estimation in the conjugate gradient method and why it works
 in finite precision computations</em></a>, Electronic Transactions on
 Numerical Analysis 13: 56-80, 2002</dd>
 </dl>
<P>

<P>
<DL>
<DT><B>Since:</B></DT>
  <DD>3.0</DD>
<DT><B>Version:</B></DT>
  <DD>$Id: ConjugateGradient.java 1416643 2012-12-03 19:37:14Z tn $</DD>
</DL>
<HR>

<P>
<!-- =========== FIELD SUMMARY =========== -->

<A NAME="field_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Field Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/linear/ConjugateGradient.html#OPERATOR">OPERATOR</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Key for the <a href="#context">exception context</a>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>static&nbsp;<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/linear/ConjugateGradient.html#VECTOR">VECTOR</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Key for the <a href="#context">exception context</a>.</TD>
</TR>
</TABLE>
&nbsp;
<!-- ======== CONSTRUCTOR SUMMARY ======== -->

<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/linear/ConjugateGradient.html#ConjugateGradient(int, double, boolean)">ConjugateGradient</A></B>(int&nbsp;maxIterations,
                  double&nbsp;delta,
                  boolean&nbsp;check)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates a new instance of this class, with <a href="#stopcrit">default
 stopping criterion</a>.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/linear/ConjugateGradient.html#ConjugateGradient(org.apache.commons.math3.util.IterationManager, double, boolean)">ConjugateGradient</A></B>(<A HREF="../../../../../org/apache/commons/math3/util/IterationManager.html" title="class in org.apache.commons.math3.util">IterationManager</A>&nbsp;manager,
                  double&nbsp;delta,
                  boolean&nbsp;check)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Creates a new instance of this class, with <a href="#stopcrit">default
 stopping criterion</a> and custom iteration manager.</TD>
</TR>
</TABLE>
&nbsp;
<!-- ========== METHOD SUMMARY =========== -->

<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/linear/ConjugateGradient.html#getCheck()">getCheck</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns <code>true</code> if positive-definiteness should be checked for both
 matrix and preconditioner.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../../../org/apache/commons/math3/linear/RealVector.html" title="class in org.apache.commons.math3.linear">RealVector</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../../../org/apache/commons/math3/linear/ConjugateGradient.html#solveInPlace(org.apache.commons.math3.linear.RealLinearOperator, org.apache.commons.math3.linear.RealLinearOperator, org.apache.commons.math3.linear.RealVector, org.apache.commons.math3.linear.RealVector)">solveInPlace</A></B>(<A HREF="../../../../../org/apache/commons/math3/linear/RealLinearOperator.html" title="class in org.apache.commons.math3.linear">RealLinearOperator</A>&nbsp;a,
             <A HREF="../../../../../org/apache/commons/math3/linear/RealLinearOperator.html" title="class in org.apache.commons.math3.linear">RealLinearOperator</A>&nbsp;m,
             <A HREF="../../../../../org/apache/commons/math3/linear/RealVector.html" title="class in org.apache.commons.math3.linear">RealVector</A>&nbsp;b,
             <A HREF="../../../../../org/apache/commons/math3/linear/RealVector.html" title="class in org.apache.commons.math3.linear">RealVector</A>&nbsp;x0)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Returns an estimate of the solution to the linear system A &middot; x =
 b.</TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_org.apache.commons.math3.linear.PreconditionedIterativeLinearSolver"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class org.apache.commons.math3.linear.<A HREF="../../../../../org/apache/commons/math3/linear/PreconditionedIterativeLinearSolver.html" title="class in org.apache.commons.math3.linear">PreconditionedIterativeLinearSolver</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../../../../org/apache/commons/math3/linear/PreconditionedIterativeLinearSolver.html#checkParameters(org.apache.commons.math3.linear.RealLinearOperator, org.apache.commons.math3.linear.RealLinearOperator, org.apache.commons.math3.linear.RealVector, org.apache.commons.math3.linear.RealVector)">checkParameters</A>, <A HREF="../../../../../org/apache/commons/math3/linear/PreconditionedIterativeLinearSolver.html#solve(org.apache.commons.math3.linear.RealLinearOperator, org.apache.commons.math3.linear.RealLinearOperator, org.apache.commons.math3.linear.RealVector)">solve</A>, <A HREF="../../../../../org/apache/commons/math3/linear/PreconditionedIterativeLinearSolver.html#solve(org.apache.commons.math3.linear.RealLinearOperator, org.apache.commons.math3.linear.RealLinearOperator, org.apache.commons.math3.linear.RealVector, org.apache.commons.math3.linear.RealVector)">solve</A>, <A HREF="../../../../../org/apache/commons/math3/linear/PreconditionedIterativeLinearSolver.html#solve(org.apache.commons.math3.linear.RealLinearOperator, org.apache.commons.math3.linear.RealVector)">solve</A>, <A HREF="../../../../../org/apache/commons/math3/linear/PreconditionedIterativeLinearSolver.html#solve(org.apache.commons.math3.linear.RealLinearOperator, org.apache.commons.math3.linear.RealVector, org.apache.commons.math3.linear.RealVector)">solve</A>, <A HREF="../../../../../org/apache/commons/math3/linear/PreconditionedIterativeLinearSolver.html#solveInPlace(org.apache.commons.math3.linear.RealLinearOperator, org.apache.commons.math3.linear.RealVector, org.apache.commons.math3.linear.RealVector)">solveInPlace</A></CODE></TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_org.apache.commons.math3.linear.IterativeLinearSolver"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class org.apache.commons.math3.linear.<A HREF="../../../../../org/apache/commons/math3/linear/IterativeLinearSolver.html" title="class in org.apache.commons.math3.linear">IterativeLinearSolver</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../../../../org/apache/commons/math3/linear/IterativeLinearSolver.html#checkParameters(org.apache.commons.math3.linear.RealLinearOperator, org.apache.commons.math3.linear.RealVector, org.apache.commons.math3.linear.RealVector)">checkParameters</A>, <A HREF="../../../../../org/apache/commons/math3/linear/IterativeLinearSolver.html#getIterationManager()">getIterationManager</A></CODE></TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></B></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD>
</TR>
</TABLE>
&nbsp;
<P>

<!-- ============ FIELD DETAIL =========== -->

<A NAME="field_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Field Detail</B></FONT></TH>
</TR>
</TABLE>

<A NAME="OPERATOR"><!-- --></A><H3>
OPERATOR</H3>
<PRE>
public static final <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>OPERATOR</B></PRE>
<DL>
<DD>Key for the <a href="#context">exception context</a>.
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../../constant-values.html#org.apache.commons.math3.linear.ConjugateGradient.OPERATOR">Constant Field Values</A></DL>
</DL>
<HR>

<A NAME="VECTOR"><!-- --></A><H3>
VECTOR</H3>
<PRE>
public static final <A HREF="http://download.oracle.com/javase/6/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>VECTOR</B></PRE>
<DL>
<DD>Key for the <a href="#context">exception context</a>.
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../../../../constant-values.html#org.apache.commons.math3.linear.ConjugateGradient.VECTOR">Constant Field Values</A></DL>
</DL>

<!-- ========= CONSTRUCTOR DETAIL ======== -->

<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TH>
</TR>
</TABLE>

<A NAME="ConjugateGradient(int, double, boolean)"><!-- --></A><H3>
ConjugateGradient</H3>
<PRE>
public <B>ConjugateGradient</B>(int&nbsp;maxIterations,
                         double&nbsp;delta,
                         boolean&nbsp;check)</PRE>
<DL>
<DD>Creates a new instance of this class, with <a href="#stopcrit">default
 stopping criterion</a>.
<P>
<DL>
<DT><B>Parameters:</B><DD><CODE>maxIterations</CODE> - the maximum number of iterations<DD><CODE>delta</CODE> - the &delta; parameter for the default stopping criterion<DD><CODE>check</CODE> - <code>true</code> if positive definiteness of both matrix and
 preconditioner should be checked</DL>
</DL>
<HR>

<A NAME="ConjugateGradient(org.apache.commons.math3.util.IterationManager, double, boolean)"><!-- --></A><H3>
ConjugateGradient</H3>
<PRE>
public <B>ConjugateGradient</B>(<A HREF="../../../../../org/apache/commons/math3/util/IterationManager.html" title="class in org.apache.commons.math3.util">IterationManager</A>&nbsp;manager,
                         double&nbsp;delta,
                         boolean&nbsp;check)
                  throws <A HREF="../../../../../org/apache/commons/math3/exception/NullArgumentException.html" title="class in org.apache.commons.math3.exception">NullArgumentException</A></PRE>
<DL>
<DD>Creates a new instance of this class, with <a href="#stopcrit">default
 stopping criterion</a> and custom iteration manager.
<P>
<DL>
<DT><B>Parameters:</B><DD><CODE>manager</CODE> - the custom iteration manager<DD><CODE>delta</CODE> - the &delta; parameter for the default stopping criterion<DD><CODE>check</CODE> - <code>true</code> if positive definiteness of both matrix and
 preconditioner should be checked
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../../org/apache/commons/math3/exception/NullArgumentException.html" title="class in org.apache.commons.math3.exception">NullArgumentException</A></CODE> - if <code>manager</code> is <code>null</code></DL>
</DL>

<!-- ============ METHOD DETAIL ========== -->

<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Method Detail</B></FONT></TH>
</TR>
</TABLE>

<A NAME="getCheck()"><!-- --></A><H3>
getCheck</H3>
<PRE>
public final boolean <B>getCheck</B>()</PRE>
<DL>
<DD>Returns <code>true</code> if positive-definiteness should be checked for both
 matrix and preconditioner.
<P>
<DD><DL>

<DT><B>Returns:</B><DD><code>true</code> if the tests are to be performed</DL>
</DD>
</DL>
<HR>

<A NAME="solveInPlace(org.apache.commons.math3.linear.RealLinearOperator, org.apache.commons.math3.linear.RealLinearOperator, org.apache.commons.math3.linear.RealVector, org.apache.commons.math3.linear.RealVector)"><!-- --></A><H3>
solveInPlace</H3>
<PRE>
public <A HREF="../../../../../org/apache/commons/math3/linear/RealVector.html" title="class in org.apache.commons.math3.linear">RealVector</A> <B>solveInPlace</B>(<A HREF="../../../../../org/apache/commons/math3/linear/RealLinearOperator.html" title="class in org.apache.commons.math3.linear">RealLinearOperator</A>&nbsp;a,
                               <A HREF="../../../../../org/apache/commons/math3/linear/RealLinearOperator.html" title="class in org.apache.commons.math3.linear">RealLinearOperator</A>&nbsp;m,
                               <A HREF="../../../../../org/apache/commons/math3/linear/RealVector.html" title="class in org.apache.commons.math3.linear">RealVector</A>&nbsp;b,
                               <A HREF="../../../../../org/apache/commons/math3/linear/RealVector.html" title="class in org.apache.commons.math3.linear">RealVector</A>&nbsp;x0)
                        throws <A HREF="../../../../../org/apache/commons/math3/exception/NullArgumentException.html" title="class in org.apache.commons.math3.exception">NullArgumentException</A>,
                               <A HREF="../../../../../org/apache/commons/math3/linear/NonPositiveDefiniteOperatorException.html" title="class in org.apache.commons.math3.linear">NonPositiveDefiniteOperatorException</A>,
                               <A HREF="../../../../../org/apache/commons/math3/linear/NonSquareOperatorException.html" title="class in org.apache.commons.math3.linear">NonSquareOperatorException</A>,
                               <A HREF="../../../../../org/apache/commons/math3/exception/DimensionMismatchException.html" title="class in org.apache.commons.math3.exception">DimensionMismatchException</A>,
                               <A HREF="../../../../../org/apache/commons/math3/exception/MaxCountExceededException.html" title="class in org.apache.commons.math3.exception">MaxCountExceededException</A>,
                               <A HREF="../../../../../org/apache/commons/math3/linear/NonPositiveDefiniteOperatorException.html" title="class in org.apache.commons.math3.linear">NonPositiveDefiniteOperatorException</A></PRE>
<DL>
<DD>Returns an estimate of the solution to the linear system A &middot; x =
 b. The solution is computed in-place (initial guess is modified).
<P>
<DD><DL>
<DT><B>Specified by:</B><DD><CODE><A HREF="../../../../../org/apache/commons/math3/linear/PreconditionedIterativeLinearSolver.html#solveInPlace(org.apache.commons.math3.linear.RealLinearOperator, org.apache.commons.math3.linear.RealLinearOperator, org.apache.commons.math3.linear.RealVector, org.apache.commons.math3.linear.RealVector)">solveInPlace</A></CODE> in class <CODE><A HREF="../../../../../org/apache/commons/math3/linear/PreconditionedIterativeLinearSolver.html" title="class in org.apache.commons.math3.linear">PreconditionedIterativeLinearSolver</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>a</CODE> - the linear operator A of the system<DD><CODE>m</CODE> - the preconditioner, M (can be <code>null</code>)<DD><CODE>b</CODE> - the right-hand side vector<DD><CODE>x0</CODE> - the initial guess of the solution
<DT><B>Returns:</B><DD>a reference to <code>x0</code> (shallow copy) updated with the
 solution
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../../../../org/apache/commons/math3/linear/NonPositiveDefiniteOperatorException.html" title="class in org.apache.commons.math3.linear">NonPositiveDefiniteOperatorException</A></CODE> - if <code>a</code> or <code>m</code> is
 not positive definite
<DD><CODE><A HREF="../../../../../org/apache/commons/math3/exception/NullArgumentException.html" title="class in org.apache.commons.math3.exception">NullArgumentException</A></CODE> - if one of the parameters is <code>null</code>
<DD><CODE><A HREF="../../../../../org/apache/commons/math3/linear/NonSquareOperatorException.html" title="class in org.apache.commons.math3.linear">NonSquareOperatorException</A></CODE> - if <code>a</code> or <code>m</code> is not
 square
<DD><CODE><A HREF="../../../../../org/apache/commons/math3/exception/DimensionMismatchException.html" title="class in org.apache.commons.math3.exception">DimensionMismatchException</A></CODE> - if <code>m</code>, <code>b</code> or
 <code>x0</code> have dimensions inconsistent with <code>a</code>
<DD><CODE><A HREF="../../../../../org/apache/commons/math3/exception/MaxCountExceededException.html" title="class in org.apache.commons.math3.exception">MaxCountExceededException</A></CODE> - at exhaustion of the iteration count,
 unless a custom
 <A HREF="../../../../../org/apache/commons/math3/util/Incrementor.MaxCountExceededCallback.html" title="interface in org.apache.commons.math3.util"><CODE>callback</CODE></A>
 has been set at construction of the <A HREF="../../../../../org/apache/commons/math3/util/IterationManager.html" title="class in org.apache.commons.math3.util"><CODE>IterationManager</CODE></A></DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>


<!-- ======= START OF BOTTOM NAVBAR ====== -->
<A NAME="navbar_bottom"><!-- --></A>
<A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/ConjugateGradient.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../../../org/apache/commons/math3/linear/CholeskyDecomposition.html" title="class in org.apache.commons.math3.linear"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../../../org/apache/commons/math3/linear/DecompositionSolver.html" title="interface in org.apache.commons.math3.linear"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../../../index.html?org/apache/commons/math3/linear/ConjugateGradient.html" target="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="ConjugateGradient.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
&nbsp;<SCRIPT type="text/javascript">
  <!--
  if(window==top) {
    document.writeln('<A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>');
  }
  //-->
</SCRIPT>
<NOSCRIPT>
  <A HREF="../../../../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>


</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY:&nbsp;NESTED&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL:&nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_bottom"></A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->

<HR>
Copyright &#169; 2003-2013 <a href="http://www.apache.org/">The Apache Software Foundation</a>. All Rights Reserved.
</BODY>
</HTML>
